#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+5;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=(x<<1)+(x<<3)+ch-48,ch=getchar();}
	return x*f;
}
bool SSS;

int n,H,W;
int mxh,mnh,mxw,mnw;
string s;
char ans[N];

char p[3][4]={
    {'R','R','B','B'},
    {'G','G','G','G'},
    {'B','B','R','R'},
};
//x:R,y:G,z:B
char pos(int x,int y){
    return p[(x%3+3)%3][(y%4+4)%4];
}
//P(h,w)
bool TTT;

int S,T;

signed main(){
	freopen("snake.in","r",stdin);
	freopen("snake.out","w",stdout);
    cin>>s;
    for(int i=0;i<s.size();i++){
        char ch=s[i];
        int vh=0,vw=0,wl=0;
        if((H%3+3)%3==0&&(W%4+4)%4==0&&ch=='B') vh=-1,vw=-1;
        else if((H%3+3)%3==0&&(W%4+4)%4==1&&ch=='B') vh=-1,vw=1;
        else if((H%3+3)%3==0&&(W%4+4)%4==2&&ch=='R') vh=-1,vw=-1;
        else if((H%3+3)%3==0&&(W%4+4)%4==3&&ch=='R') vh=-1,vw=1;
        else if((H%3+3)%3==2&&(W%4+4)%4==0&&ch=='R') vh=1,vw=-1;
        else if((H%3+3)%3==2&&(W%4+4)%4==1&&ch=='R') vh=1,vw=1;
        else if((H%3+3)%3==2&&(W%4+4)%4==2&&ch=='B') vh=1,vw=-1;
        else if((H%3+3)%3==2&&(W%4+4)%4==3&&ch=='B') vh=1,vw=1;
        else if((H%3+3)%3==1&&ch=='G') wl=1;

        if(wl){
            int d1=W-mnw,d2=mxw-W;
            if(d1>d2) W--,ans[i]='L';
            else W++,ans[i]='R';
        }
        else if(abs(vh)){
            int dh=0,dw=0;
            int dw1=W-mnw,dw2=mxw-W;
			int dh1=H-mnh,dh2=mxh-H;

            int dW1=(W+vw)-mnw,dW2=mxw-(W+vw);
			int dH1=(H+vh)-mnh,dH2=mxh-(H+vh);
			
			if(dw1>dw2&&vw==-1) W--,ans[i]='L';
			else if(dw1<=dw2&&vw==1) W++,ans[i]='R';
			else if(dh1>dh2&&vh==-1) H--,ans[i]='U';
			else if(dh1<=dh2&&vh==1) H++,ans[i]='D';
			else if(max(dW1,dW2)>max(dH1,dH2)) H+=vh,ans[i]=(vh==-1)?'U':'D';
			else W+=vw,ans[i]=(vw==-1)?'L':'R';
        }
        else{
            if(pos(H-1,W)==ch) H--,ans[i]='U';
            else if(pos(H+1,W)==ch) H++,ans[i]='D';
            else if(pos(H,W+1)==ch) W++,ans[i]='R';
            else W--,ans[i]='L';
        }

        mxh=max(mxh,H);
        mnh=min(mnh,H);
        mxw=max(mxw,W);
        mnw=min(mnw,W);
        if(i==0) S=H,T=W;
    }
    S+=abs(mnh)+1;
    T+=abs(mnw)+1;
    printf("%lld %lld\n",mxh+abs(mnh)+1,mxw+abs(mnw)+1);
    for(int i=mnh;i<=mxh;i++){
        for(int j=mnw;j<=mxw;j++)
            cout<<pos(i,j);
        printf("\n");
    }
    printf("%lld %lld\n",S,T);
    for(int i=1;i<s.size();i++)
        cout<<ans[i];
	return 0;
}